a = list(map(int, input().split()))
b = list(map(int, input().split()))
if(a[0] == b[0]):
    print("INF")
else:
    print((b[1]-a[1])//(b[0]-a[0]))
